package com.itlong.cloud.POJO.PO;

import com.itlong.cloud.annotation.ItlField;
import com.itlong.cloud.annotation.ItlTables;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <desc>
 * 物业用户实体类
 * </desc>
 *
 * @createDate 2017/10/12
 */
@ItlTables("property_user_info")
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class PropertyUserInfoPO extends BasePO implements Serializable {


    /**
     * 用户id
     */
    @ItlField(value = "user_id", logicKey = "key")
    private String userId;

    /**
     * 角色id
     */
    @ItlField("role_id")
    private String roleId;

    /**
     * 部门id
     */
    @ItlField("group_id")
    private String groupId;

    /**
     * 人员编号
     */
    @ItlField("user_num")
    private String userNum;

    /**
     * 账户名
     */
    @ItlField("user_name")
    private String userName;

    /**
     * 姓名
     */
    @ItlField("real_name")
    private String realName;

    /**
     * 密码
     */
    @ItlField("password")
    private String password;

    /**
     * 用户手机号
     */
    @ItlField("phone_num")
    private String phoneNum;

    /**
     * 物业名称 （运营系统里用，物业系统不需要关注这个字段）
     */
    @ItlField("property_name")
    private String propertyName;

    /**
     * 性别：0男 1女
     */
    @ItlField("gender")
    private Integer gender;

    /**
     * 生日
     */
    @ItlField("birthday")
    private Date birthday;

    /**
     * 备注
     */
    @ItlField("description")
    private String description;

    /**
     * 请求ip地址
     */
    @ItlField("ip_address")
    private String ipAddress;

    /**
     * 应用接入秘钥
     */
    @ItlField("appsecret")
    private String appsecret;

    @ItlField("administrator_phone")
    private String administratorPhone;      // 管理员绑定手机号

    @ItlField("property_phone")
    private String propertyPhone;       // 物业联系方式

    @ItlField("country_id")
    private String countryId;           // 国家ID

    @ItlField("province_id")
    private String provinceId;              // 省ID

    @ItlField("city_id")
    private String cityId;              // 市ID

    @ItlField("district_id")
    private String districtId;              // 区ID

    @ItlField("address")
    private String address;              // 详细地址

    @ItlField("safety_verify_time")
    private Date safetyVerifyTime;              // 最后一次安全验证时间

    @ItlField("system_inform")
    private Integer systemInform;              // 物业app系统通知，0关闭，1打开

    @ItlField("inside_inform")
    private Integer insideInform;              // 物业app内部通知，0关闭，1打开

    @ItlField("mute_start")
    private String muteStart;              // 静音免打扰时段起始

    @ItlField("mute_end")
    private String muteEnd;              // 静音免打扰时段结束

    @ItlField("photo_url")
    private String photoUrl;           //头像地址

    @ItlField("cloud_intercom_account_id")
    private String cloudIntercomAccountId;           //与第三方云对讲账号信息表相关联

    @ItlField("sip_account")
    private String sipAccount;           //sip账号

    @ItlField("sip_psd")
    private String sipPsd;           //sip密码

    @ItlField("current_project_id")
    private String currentProjectId;   //当前项目id（物业app）

    @ItlField("password_time")
    private Date passwordTime;              // 上次修改密码时间

    @ItlField("dock_mode")
    private String dockMode;       //1云对接 2局域网对接

    @ItlField("login_count")
    private Integer loginCount;     //登录个数限制

    @ItlField("effect_start_time")
    private Date effectStartTime; //生效开始时间

    @ItlField("effect_end_time")
    private Date effectEndTime;     //生效结束时间

    @ItlField("robot_switch")
    private Integer robotSwitch;    //调试机器人开关 1开启 0关闭

    private String loginType;      //1开发者登录 2工程人员登录

    private List<String> robotUniques;  //机器人唯一码

    /**
     * 一卡通开发者通行牌照，包含项目id，对接appId，有效期，功能列表的加密串，
     * 根据appSecret可进行解密得到明文json串，json示例：{"appId":"666065393235951616","function":"1,2,3,4,5","endTime":"2019-08-20 23:59:59","projectId":"00000126"}
     */
    @ItlField("licence")
    private String licence;

    //sdk开发者判断token是否过期使用
    private String token;
    //加密方式 null或者0 为AES  1和SMS
    private String encryptType;
    //机器人编号
    private String robotId;


    public PropertyUserInfoPO(String userId, String userNum, String password) {
        this.userId = userId;
        this.userNum = userNum;
        this.password = password;
    }

    public PropertyUserInfoPO(String userId, String appsecret) {
        this.userId = userId;
        this.appsecret = appsecret;
    }
}